------------------------------------------------------------------------------------------------------
       log:  C:\DATA\pres_runoff_extra.log
  log type:  text
 opened on:  18 May 2005, 10:52:00

.  #delimit ;
delimiter now ;
. *     ***************************************************************** *;
. *     ***************************************************************** *;
. *       File-Name:      pres_runoff_extra.do                            *;
. *       Date:           5/18/05                                         *;
. *       Author:         MRG                                             *;
. *       Purpose:        Do-file to replicate results for AJPS version   *;
. *                       of presidential candidates paper where          *;
. *                       dependent variable is presidential candidates   *;
. *                       for additional cross-sections.                  *;
. *       Input File:     pcross_extra.dta                                *;
. *       Output File:    pres_runoff_extra.log                           *;
. *       Data Output:    None                                            *;
. *       Previous file:                                                  *;
. *       Machine:        Home                                            *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. set mem 10m;
(10240k)

. set matsize 150;

. use c:\ajps\pcross_extra.dta;

. *     ****************************************************************  *;
. *                           Summary Statistics                          *;
. *     ****************************************************************  *;
. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       294    87.93197    41.47686          3        198
        year |       294    1980.588     16.4538       1946       2000
   eighties1 |       294    .0884354    .2844111          0          1
    eighties |       294     .085034    .2794079          0          1
-------------+--------------------------------------------------------
eighties_new |       294    .0884354    .2844111          0          1
nineties_l~r |       294    .2040816    .4037161          0          1
   nineties1 |       294    .2040816    .4037161          0          1
    nineties |       294    .2006803    .4011922          0          1
nineties_u~r |       294    .2040816    .4037161          0          1
-------------+--------------------------------------------------------
         old |       294     .755102    .4307599          0          1
      avemag |       276    10.88268     21.9662          1        150
electorals~r |       278    2.028777    1.656156          1         12
        eneg |       252    2.021872    1.169619   1.004012   8.176613
       enep1 |       251    4.347012    4.031235       1.35       46.1
-------------+--------------------------------------------------------
       enpp1 |       261    4.114444    11.25567       1.12     178.65
      enpres |       289    2.772965    1.137473          1       6.57
       fused |       294    .1088435    .3119738          0          1
 institution |       294    2.527211     .704162          1          3
     legelec |       294    .6598639    .4745625          0          1
-------------+--------------------------------------------------------
      newdem |       294    .1836735    .3878779          0          1
pres_college |       294     .085034    .2794079          0          1
pres_major~y |       294    .3673469    .4829041          0          1
pres_plura~y |       294    .3673469    .4829041          0          1
pres_qualm~y |       294    .1428571    .3505237          0          1
-------------+--------------------------------------------------------
 pres_runoff |       294    .5102041    .5007482          0          1
    pres_stv |       294     .037415       .1901          0          1
    preselec |       294           1           0          1          1
proportional |       294    .3503401    .4778899          0          1
  proximity1 |       194    .9948454    .0717958          0          1
-------------+--------------------------------------------------------
  proximity2 |       196    .9846939    .1230818          0          1
      regime |       294    .0238095    .1527153          0          1
      region |       294    7.173469    2.610136          1         10
     region1 |       294    7.078231    2.540592          1         10
   uppertier |       278    5.623741    12.23941          0      77.95
-------------+--------------------------------------------------------
preselecsy~m |       293     2.05802    1.088567          1          5

. *     ****************************************************************  *;
. *                    Relabel and Define Variables                       *;
. *     ****************************************************************  *;
. label var country  "countryname";

. label var newdem "first election as new democracy";

. label var countrynumber "countrynumber";

. label var year "year";

. label var regime "regime as of 31 December of given year 0=democracy 1=dictatorship";

. label var legelec "legislative election";

. label var preselec "presidential election";

. label var eighties "election in 1980s closest to 1985";

. label var old "elections in countries that did not transition to democracy in 1990s";

. label var nineties "elections in 1990s closest to 1995";

. label var proximity1 "proximity - continuous";

. label var proximity2 "proximity - dichotomous";

. label var enpp "parliamentary parties - uncorrected";

. label var enpp1 "parliamentary parties - corrected";

. label var enep "electoral parties - uncorrected";

. label var enep1 "electoral parties - corrected";

. label var enpres "effective number of presidential candidates";

. label var uppertier "percentage of uppertier seats";

. label var eneg "effective number of ethnic groups  fearon";

. describe;

Contains data from c:\ajps\pcross_extra.dta
  obs:           294                          
 vars:            36                          24 May 2004 09:52
 size:        24,402 (99.8% of memory free)
-------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
-------------------------------------------------------------------------------
country         str24  %24s                   countryname
countrynumber   int    %8.0g                  countrynumber
year            int    %8.0g                  year
eighties1       byte   %8.0g                  
eighties        byte   %8.0g                  election in 1980s closest to
                                                1985
eighties_new    byte   %8.0g                  
nineties_lower  byte   %8.0g                  
nineties1       byte   %8.0g                  
nineties        byte   %8.0g                  elections in 1990s closest to
                                                1995
nineties_upper  byte   %8.0g                  
old             byte   %8.0g                  elections in countries that did
                                                not transition to democracy in
                                                1990s
avemag          float  %9.0g                  
electoralsyst~r byte   %8.0g                  
eneg            float  %9.0g                  effective number of ethnic
                                                groups  fearon
enep1           float  %9.0g                  electoral parties - corrected
enpp1           float  %9.0g                  parliamentary parties -
                                                corrected
enpres          float  %9.0g                  effective number of
                                                presidential candidates
fused           byte   %8.0g                  
institution     byte   %8.0g                  
legelec         byte   %8.0g                  legislative election
newdem          byte   %8.0g                  first election as new democracy
pres_college    byte   %8.0g                  
pres_majority   byte   %8.0g                  
pres_plurality  byte   %8.0g                  
pres_qualmajo~y byte   %8.0g                  
pres_runoff     byte   %8.0g                  
pres_stv        byte   %8.0g                  
preselec        byte   %8.0g                  presidential election
proportional    byte   %8.0g                  
proximity1      byte   %8.0g                  proximity - continuous
proximity2      byte   %8.0g                  proximity - dichotomous
regime          byte   %8.0g                  regime as of 31 December of
                                                given year 0=democracy
                                                1=dictatorship
region          byte   %8.0g                  
region1         byte   %8.0g                  
uppertier       float  %9.0g                  percentage of uppertier seats
preselecsystem  byte   %8.0g                  
-------------------------------------------------------------------------------
Sorted by:  

. *     ****************************************************************  *;
. *       Would like to drop certain countries that do not fit.           *;
. *       1. Drop Kiribati - not free entry of candidates                 *;
. *       2. Drop elections that ultimately use an electoral college      *;
. *       to determine who wins.  This means dropping Argentina 1946,     *;
. *       1958, 1963, 1983, 1989, United States (all presidential         *;
. *       elections), Finland 1950, 1956, 1962, 1968, 1978, 1982.         *;
. *       3. Drop Ireland (all presidential elections) and Sri Lanka      *;
. *       1994, 1999 since they use STV.                                  *;
. *     ****************************************************************  *;
. drop if countrynumber==163;
(6 observations deleted)

. drop if countrynumber==65;
(14 observations deleted)

. drop if countrynumber==113;
(9 observations deleted)

. drop if countrynumber==96;
(2 observations deleted)

. drop if countrynumber==66 & year==1946;
(1 observation deleted)

. drop if countrynumber==66 & year==1958;
(1 observation deleted)

. drop if countrynumber==66 & year==1963;
(1 observation deleted)

. drop if countrynumber==66 & year==1983;
(1 observation deleted)

. drop if countrynumber==66 & year==1989;
(1 observation deleted)

. drop if countrynumber==106 & year==1950;
(1 observation deleted)

. drop if countrynumber==106 & year==1956;
(1 observation deleted)

. drop if countrynumber==106 & year==1962;
(1 observation deleted)

. drop if countrynumber==106 & year==1968;
(1 observation deleted)

. drop if countrynumber==106 & year==1978;
(1 observation deleted)

. drop if countrynumber==106 & year==1982;
(1 observation deleted)

. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       252    86.46429    42.44475          3        198
        year |       252    1981.444    16.41157       1946       2000
   eighties1 |       252    .0833333    .2769354          0          1
    eighties |       252    .0793651    .2708456          0          1
-------------+--------------------------------------------------------
eighties_new |       252    .0833333    .2769354          0          1
nineties_l~r |       252    .2222222    .4165671          0          1
   nineties1 |       252    .2222222    .4165671          0          1
    nineties |       252     .218254    .4138828          0          1
nineties_u~r |       252    .2222222    .4165671          0          1
-------------+--------------------------------------------------------
         old |       252    .7222222    .4487946          0          1
      avemag |       234    11.99073    23.61834          1        150
electorals~r |       236    2.072034    1.518363          1         12
        eneg |       216    2.102011    1.236922   1.004012   8.176613
       enep1 |       215    4.543023    4.289694       1.35       46.1
-------------+--------------------------------------------------------
       enpp1 |       225    4.317956     12.1053       1.12     178.65
      enpres |       250    2.791039    1.109777          1       6.57
       fused |       252    .1269841    .3336178          0          1
 institution |       252    2.599206    .6390975          1          3
     legelec |       252    .6547619     .476392          0          1
-------------+--------------------------------------------------------
      newdem |       252    .1944444      .39656          0          1
pres_college |       252           0           0          0          0
pres_major~y |       252    .4285714    .4958565          0          1
pres_plura~y |       252    .4047619    .4918227          0          1
pres_qualm~y |       252    .1666667    .3734196          0          1
-------------+--------------------------------------------------------
 pres_runoff |       252    .5952381    .4918227          0          1
    pres_stv |       252           0           0          0          0
    preselec |       252           1           0          1          1
proportional |       252    .3849206    .4875449          0          1
  proximity1 |       165    .9939394    .0778499          0          1
-------------+--------------------------------------------------------
  proximity2 |       167    .9820359    .1332203          0          1
      regime |       252    .0277778    .1646626          0          1
      region |       252    6.944444    2.578815          1         10
     region1 |       252    6.944444    2.578815          1         10
   uppertier |       236    6.515339    13.03632          0      77.95
-------------+--------------------------------------------------------
preselecsy~m |       251    1.760956    .7145834          1          3

. *     ****************************************************************  *;
. *       There were two elections in Argentina in 1973.  Need to remove  *;
. *       one of them.  This leaves 213 elections, 134 runoff, 79         *;
. *       plurality, 53 countries.                                        *;
. *     ****************************************************************  *;
. drop if countrynumber==66& year==1973 &enpres>3;
(1 observation deleted)

. sum enpres if eighties==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
      enpres |        20      2.9745    1.234267          1       5.69

. sum enpres if nineties==1;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
      enpres |        55    3.158727    1.222044       1.17       6.12

. *     ****************************************************************  *;
. *       24 countries had presidential elections in the 1980s.           *;
. *       59 countries had presidential elections in the 1990s.           *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                   Create variables ready for regressions              *;
. *     ****************************************************************  *;
. gen eneg_runoff = eneg*pres_runoff;
(36 missing values generated)

. *     ****************************************************************  *;
. *                       Election closest to 1985                        *;
. *     ****************************************************************  *;
. regress enpres eneg pres_runoff  eneg_runoff if eighties==1, robust;

Regression with robust standard errors                 Number of obs =      17
                                                       F(  3,    13) =    4.40
                                                       Prob > F      =  0.0240
                                                       R-squared     =  0.4579
                                                       Root MSE      =  1.0006

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |   .0985028   .1315766     0.75   0.467    -.1857511    .3827567
 pres_runoff |   .2754729   .8462154     0.33   0.750    -1.552664     2.10361
 eneg_runoff |   .5510841   .3353986     1.64   0.124    -.1735005    1.275669
       _cons |   2.132084   .4645169     4.59   0.001     1.128556    3.135612
------------------------------------------------------------------------------

. regress enpres eneg pres_runoff  eneg_runoff if eighties1==1, robust;

Regression with robust standard errors                 Number of obs =      18
                                                       F(  3,    14) =    4.82
                                                       Prob > F      =  0.0165
                                                       R-squared     =  0.4794
                                                       Root MSE      =   .9657

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |   .1073367   .1239648     0.87   0.401    -.1585414    .3732148
 pres_runoff |    .321737   .8141723     0.40   0.699    -1.424489    2.067963
 eneg_runoff |   .5422502   .3300719     1.64   0.123    -.1656836    1.250184
       _cons |    2.08582   .4134978     5.04   0.000     1.198955    2.972684
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar conb=b1+b3*1;

. display conb;
.64958688

. scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);

. display conse;
.30590874

. scalar t=conb/conse;

. display t;
2.1234662

. *     ****************************************************************  *;
. *           What is the effect of eneg as runoff changes in the 1980s?  *;
. *           When runoff is 0, then the effect of eneg is 0.11 (0.12)    *;
. *           When runoff is 1, then the effect of eneg is 0.65 (0.31)    *;
. *           When runoff is 1, eneg is significant at the 90% level and  *;
. *           very close to 95%.                                          *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                       Election closest to 1980                        *;
. *     ****************************************************************  *;
. regress enpres eneg pres_runoff  eneg_runoff if eighties_new==1, robust;

Regression with robust standard errors                 Number of obs =      18
                                                       F(  3,    14) =    4.84
                                                       Prob > F      =  0.0162
                                                       R-squared     =  0.4792
                                                       Root MSE      =  .99519

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |   .1314398   .1048573     1.25   0.231    -.0934567    .3563363
 pres_runoff |  -.2022711    .969074    -0.21   0.838    -2.280728    1.876186
 eneg_runoff |   .7262022   .3893964     1.86   0.083    -.1089699    1.561374
       _cons |   2.083514   .3986037     5.23   0.000     1.228594    2.938434
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar conb=b1+b3*1;

. display conb;
.85764197

. scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);

. display conse;
.37501263

. scalar t=conb/conse;

. display t;
2.2869683

. *     ****************************************************************  *;
. *           What is the effect of eneg as runoff changes in the 1980s?  *;
. *           When runoff is 0, then the effect of eneg is 0.13 (0.10)    *;
. *           When runoff is 1, then the effect of eneg is 0.86 (0.38)    *;
. *           When runoff is 1, eneg is significant at the 95% level.     *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                  Election closest to 1995                             *;
. *     ****************************************************************  *;
. regress enpres eneg pres_runoff eneg_runoff if nineties1==1, robust;

Regression with robust standard errors                 Number of obs =      49
                                                       F(  3,    45) =    3.52
                                                       Prob > F      =  0.0223
                                                       R-squared     =  0.0833
                                                       Root MSE      =  1.1812

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |  -.2523976    .121702    -2.07   0.044    -.4975181   -.0072771
 pres_runoff |  -.8157799    .571637    -1.43   0.160    -1.967116    .3355561
 eneg_runoff |   .4386924   .1509718     2.91   0.006     .1346196    .7427653
       _cons |    3.62873   .4758803     7.63   0.000     2.670258    4.587202
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar conb=b1+b3*1;

. display conb;
.18629483

. scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);

. display conse;
.08933702

. scalar t=conb/conse;

. display t;
2.0853038

. *     ****************************************************************  *;
. *       Effect of eneg in plurality systems is -0.25 (0.12).            *;
. *       Effect of eneg in runoff systems is 0.19 (0.09).                *;
. *       Thus, eneg is significant at 95% level when runoff=1            *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                  Election closest to 1990                             *;
. *     ****************************************************************  *;
. regress enpres eneg pres_runoff eneg_runoff if nineties_lower==1, robust;

Regression with robust standard errors                 Number of obs =      48
                                                       F(  3,    44) =    6.21
                                                       Prob > F      =  0.0013
                                                       R-squared     =  0.1246
                                                       Root MSE      =  1.2542

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |  -.2293939   .1479785    -1.55   0.128     -.527625    .0688372
 pres_runoff |  -1.188085   .7027497    -1.69   0.098    -2.604384    .2282138
 eneg_runoff |   .5239061   .1701879     3.08   0.004     .1809149    .8668973
       _cons |   3.657764   .6102546     5.99   0.000     2.427876    4.887651
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar conb=b1+b3*1;

. display conb;
.29451214

. scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);

. display conse;
.0840612

. scalar t=conb/conse;

. display t;
3.5035445

. *     ****************************************************************  *;
. *       Effect of eneg in plurality systems is -0.23 (0.15).            *;
. *       Effect of eneg in runoff systems is 0.29 (0.08).                *;
. *       Thus, eneg is significant at 99% level when runoff=1            *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                  Election closest to 2000                             *;
. *     ****************************************************************  *;
. regress enpres eneg pres_runoff eneg_runoff if nineties_upper==1, robust;

Regression with robust standard errors                 Number of obs =      49
                                                       F(  3,    45) =    7.21
                                                       Prob > F      =  0.0005
                                                       R-squared     =  0.1197
                                                       Root MSE      =  1.0552

------------------------------------------------------------------------------
             |               Robust
      enpres |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        eneg |   -.306081   .0956393    -3.20   0.003    -.4987084   -.1134535
 pres_runoff |  -.7719398   .5003183    -1.54   0.130    -1.779633     .235753
 eneg_runoff |   .4966628   .1500676     3.31   0.002     .1944112    .7989144
       _cons |   3.583005   .4131377     8.67   0.000     2.750903    4.415107
------------------------------------------------------------------------------

. matrix b=e(b);

. matrix V=e(V);

. scalar b1=b[1,1];

. scalar b3=b[1,3];

. scalar varb1=V[1,1];

. scalar varb3=V[3,3];

. scalar covb1b3=V[1,3];

. scalar conb=b1+b3*1;

. display conb;
.1905818

. scalar conse=sqrt(varb1+varb3*1^2+2*covb1b3*1);

. display conse;
.11564342

. scalar t=conb/conse;

. display t;
1.6480125

. *     ****************************************************************  *;
. *       Effect of eneg in plurality systems is -0.31 (0.10).            *;
. *       Effect of eneg in runoff systems is 0.19 (0.12).                *;
. *       Thus, eneg is almost significant at 90% level when runoff=1     *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                                   THE END                             *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. exit;

end of do-file

.               log close
       log:  C:\DATA\pres_runoff_extra.log
  log type:  text
 closed on:  18 May 2005, 10:53:08
------------------------------------------------------------------------------------------------------
